import { base } from '@/config'
import http from '@/utils/request'

// 角色模块
const role = {
  getList: params => {
    return http.get(`${base.system}/role/getList`, params)
  },
  add: params => {
    return http.postJson(`${base.system}/role/add`, params)
  },
  update: params => {
    return http.postJson(`${base.system}/role/update`, params)
  },
  delete: id => {
    return http.post(`${base.system}/role/delete/${id}`)
  },
  getSelect: () => {
    return http.get(`${base.system}/role/getSelect`)
  },
  // 修改角色权限
  modifyRole: params => {
    return http.postJson(`${base.system}/roleValue/modifyRole`, params)
  },
  // 查询拥有的权限id
  getRoleNav: roleId => {
    return http.get(`${base.system}/roleValue/getRoleNav/${roleId}`)
  }
}

export default role
